package com.example.happiness.controller.admin;

import com.example.happiness.pojo.adminvo.AdminChatVO;
import com.example.happiness.result.Result;
import com.example.happiness.service.admin.AdminChatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "聊天相关接口")
@Slf4j
@RestController
@RequestMapping("/admin/chat")
public class AdminChatController {

    @Autowired
    private AdminChatService adminChatService;

    @GetMapping("/getChatlist")
    @ApiOperation("获取聊天列表")
    public Result<List<AdminChatVO>> getChatList() {
        List<AdminChatVO> chatlist = adminChatService.getChatList();
        return Result.success(chatlist);
    }
}
